﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace s
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private List<sinhvien> laydanhsachnv()
        {
            List<sinhvien> dsnhanvien = new List<sinhvien>();
            SqlConnection cn = dataprovider.conectiondata();
            string strsql = "select*from SinhVien ";
            SqlCommand cmd = new SqlCommand(strsql, cn);
            SqlDataReader dr;
            dr = cmd.ExecuteReader();
            sinhvien qlnv;
            while (dr.Read())
            {
                qlnv = new sinhvien();
                qlnv.Manv = dr["Manv"].ToString();
                qlnv.Hoten = dr["hoten"].ToString();
                qlnv.Phai = dr["phai"].ToString();
                

                dsnhanvien.Add(qlnv);
            }
            cn.Close();
            return dsnhanvien;
        }

    }
}
